<div id="album">
  <table width=400>
    <tr>
      <td width=200>
        <%= button_to_next @photo %>
        <%= button_to_previous @photo %>
      </td>
      <td width=200 align=left>
        <%=button_to "返回",{:action=>"view",:id=>@album}%>
          <%=button_to "删除", {:action=>"delete_photo", :id=>@photo},
          :confirm=>"删除相片同时会删除改相片的所有评论，你确定吗？" %>
        </td>
      </tr>
      <tr>
        <td colspan=4>
          <%=photo_div_with_shadow%>
        </td>
      </tr>
    </table>
  </div>

  <!--评论开始-->
  <div id="comments">
    <%="查看(#{@photo.view_count}) | 评论(#{@photo.comments.size})" %>
    <%@comments.each do |comment|%>
      <table width=600 >
        <tr>
          <td width=80%><b><%= comment.name %>:</b></td>
          <%if logged_in?%>
            <td  width=20%>
              <%=link_to_remote "删除", :url=>{:controller=>"/admin/album",
                :action=>"delete_comment",:id=>comment.id},:method=>:post %>
            </td>
          <%end%>
        </tr>
        <tr>
          <td><%=comment.content %></td>
        </tr>
      </table>
    <%end%>
    <%=will_paginate @comments,
    :remote_options =>{
      :url=>{
        :controller=>"/admin/album",
        :action=>'list_comments',:photo_id=>@photo.id},
      :method =>:post
    }%>
  </div>

  <!--评论结束-->